// 1.导入路由组件
import VueRouter from 'vue-router'
import Vue from 'vue'
import home from '@/components/home.vue'
import mine from '@/components/mine.vue'
import users from '@/components/user-management.vue'
import goods from '@/components/goods-management.vue'
import page1 from '@/views/page1.vue'
import page2 from '@/views/page2.vue'

Vue.use(VueRouter)
const routes = [
    {path: '/', component: home},
    {path: '/mine', component: mine},
    {path: '/goods', component: goods},
    {path: '/users/', component: users,
        children: [
            {path: '', component: page1},
            {path: 'page2', component: page2}
        ]
    }
]

// 2.创建路由连接
const route = new VueRouter({
    routes
})
    
//暴露出路由
export default route